package com.easy;

/**
 * Created by Lxk on 2019/7/13.
 */
public class Solution977 {

    public int[] sortedSquares(int[] A) {
        for(int i = 0;i < A.length; i++){
            A[i] = A[i]*A[i];
        }
        for(int i = 0;i < A.length-1; i++){
            for(int k = i+1; k > 0; k--){
                if(A[k]<A[k-1]){
                    int temp = A[k];
                    A[k] = A[k-1];
                    A[k-1] = temp;
                }
            }
        }
        return A;
    }

}
